Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode period at start of line #184

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chuckwagoncomputing
Copy link

For some reason I don't quite understand, a period at the beginning of a line is special.
Other email clients don't encode periods unless they are at the start of a line, so that's the example I followed here.

I'm not sure if it's possible for a period to be at the beginning of a line without being wrapped there, but I checked for that just in case.

I found this bug because it was deleting a period from a URL, breaking a link.

P.S. I'm new to Elixir so I welcome your correction

test paths where encoding is not needed

test line beginning with period
@andrewtimberlake
Copy link
Collaborator

A period at the beginning of a line is valid in an email body.
If a period exists on its own in a line, then the period will be doubled during an SMTP transmission (because a sing period followed by \r\n indicates the end of the transmission)

@chuckwagoncomputing
Copy link
Author

Then in your opinion the bug is in the SMTP client (swoosh mua adapter in my case)?

@andrewtimberlake
Copy link
Collaborator

When transmitting over SMTP, a line starting with a period should have a period added to the beginning.
When receiving over SMTP, a line received with a period at the beginning, not immediately followed by \r\n, should have the leading period removed.
See https://www.rfc-editor.org/rfc/rfc5321#section-4.5.2
It may be that the mua adapter is not adding the period during transmission. It depends on where in the process you’re picking up the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants